package design.decorate;

import java.text.*;
import java.util.*;
public class BorrowBook extends Borrow{ //装饰模式之借阅具体实现
	private String time;
	public BorrowBook(Decorate decorate) {
		super(decorate);
		Date date = new Date();
		DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		time = format.format(date);
	}
	
	public void borrow(String name){
		System.out.println("此书被"+name+"在 "+time+" 借走");
	}
}
